package com.gwz.cardserver.consts;

public enum IdentityEnum {
    /**
     * 农民
     */
    FARMER(0),
    /**
     * 地主
     */
    LANDLORD(1),
    ;
    private int code;

    IdentityEnum(int code) {
        this.code = code;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public static IdentityEnum getByCode(int code) {
        for (IdentityEnum value : values()) {
            if (value.code == code)
                return value;
        }
        return null;
    }
}
